<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			var x;
			function fun(){
				//document.body.innerHTML += "测试文字";//存在节点重新渲染的情况
				document.getElementById("txt").innerHTML += "哈";
				//x = setTimeout(fun,200)
			}	
			function stop(){
				clearInterval(x);
			}
			function stop2(){
				clearTimeout(x);
				console.log("stop");
			}
			function start(){
				x = setInterval(fun,0);
				//x = setTimeout(fun,200);
			}
		</script>
	</head>
	<body>		
		<button onclick="start()">开始</button>
		<button onclick="stop()">停止</button><br />
		<span id="txt"></span>
		<script>			
			
		</script>
	</body>
</html>
